#ifndef _BINFILE_WRAPPING_GEOMETRY_H_
#define _BINFILE_WRAPPING_GEOMETRY_H_

#include <buildspec.h>
#include <Geometry/ClientGeometry.h>

namespace GST{

	//prototypes:	
namespace ClientUtils {
	struct CrudeFeature;
}
	
namespace Geometry {
		
	class GST_API_EXPORT BinFileWrappingGeometry
	: public ClientGeometry
	{
		ClientUtils::CrudeFeature * requestFeature;
		std::string curFile;
		
	public:
		///construct empty (File->Request)
		BinFileWrappingGeometry(IGeometry::GeometryType type);
		
		///construct from string (Request->File)
		BinFileWrappingGeometry(IGeometry::GeometryType type, ClientUtils::CrudeFeature * requestFeature);
		
		virtual ~BinFileWrappingGeometry();
		virtual unsigned int addSimplexProperty(
			const std::string &name,
			ClientSimplexProperty::PropertyType PropertyType,
			unsigned int dims,
			ClientSimplexProperty::PropertyAlignment alignment
			= Geometry::VERTEX_ALIGNED);
		virtual unsigned int addSimplexProperty(const std::string & name, const ClientSimplexProperty::PropertyType & PropertyType, const unsigned int & dims);
		virtual unsigned int addSimplexProperty(const ClientSimplexProperty & p);
		virtual SmplxPropertyListPtr getProperties() const;
		virtual void setProperties(const SmplxPropertyListPtr & newlist);
		
		virtual void SaveGeometry(const std::string & filename, const FileType & filetype);
		virtual void SaveProperty(const std::string & filename, const FileType & filetype);
		virtual void saveToFile(const std::string & filename, const FileType & filetype);
		virtual void loadFromFile(const std::string&, const FileType&);

		virtual bool serializeSimplexPropertyDescription(std::ostream & os) const;
		virtual bool serializeSimplexPropertyValues(std::ostream & os) const;
		virtual bool serializeGeometry(std::ostream & os) const;
	};
	
}// namespace Geometry
}// namespace GST


#endif  //_BINFILE_WRAPPING_GEOMETRY_H_
